package com.uw.uwregistry.service;

import com.uw.uwregistry.meta.InstanceMeta;
import com.uw.uwregistry.meta.ServiceMeta;

import java.util.List;
import java.util.Map;

public interface RegistryService {

    /**
     * 注册服务
     */
    InstanceMeta register(ServiceMeta serviceMeta, InstanceMeta instanceMeta);
    /**
     * 注册服务
     */
    InstanceMeta register(String serviceSign, InstanceMeta instanceMeta);

    /**
     * 注销服务
     */
    InstanceMeta unregister(ServiceMeta serviceMeta,InstanceMeta instanceMeta);

    /**
     * 注销服务
     */
    InstanceMeta unregister(String serviceSign, InstanceMeta instanceMeta);


    /**
     * 查询服务下所有实例
     */
    List<InstanceMeta> fetchAll(ServiceMeta serviceMeta);

    long heartbeat(InstanceMeta instanceMeta, String... serviceSigns);

    Map<String, Long> version(String... serviceSigns);

    /**
     * 查询服务下所有实例
     */
    List<InstanceMeta> fetchAll(String serviceSign);






}
